package cn.tedu.micro.demo.cart.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class HelloController {
    // 利用属性注入，获取当前web应用占用的端口
    @Value("${server.port}")
    private String port;

    @GetMapping("/cart/hello")
    public String hello() {
        String msg = "Hello Gateway! I'm from " + port;
        return msg;
    }
}
